#include <iostream>
#include <signal.h>
#include <event_cpp/loop.h>
#include <event_cpp/signal_event.h>

using namespace std;
using namespace lumi;
using namespace lumi::event_cpp;

void SignalCallback()
{
    cout << "Got interupt signal" << endl;
}

int main()
{
    LoopSptr sp_loop = Loop::New(Loop::kLibeventType);

    SignalEventSptr sp_signal = sp_loop->newSignalEvent();
    sp_signal->initialize(SIGINT, Event::kPersistMode);
    sp_signal->setCallback(SignalCallback);
    sp_signal->enable();

    sp_loop->runLoop(Loop::kLoopForever);
    return 0;
}
